﻿<div class="posts index">
	<h2>DANH SÁCH TIN ĐĂNG</h2>
	<table>
	<tr>
			<th width="5%">STT</th>
			<th width="50%">Tiêu đề</th>
			<th width="25%">Ngày đăng</th>
			<th width="15%">Thành phố</th>
			<th class="actions" width="15%"><?php __('Actions');?></th>
	</tr>
	<?php
	$i = 0;
	foreach ($data as $post):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $i; ?>&nbsp;</td>
		<td><?php echo $post['posts']['tieude']; ?>&nbsp;</td>
		<td><?php echo $post['posts']['created']; ?>&nbsp;</td>
		<td><?php echo $post['posts']['tinhthanh']; ?>&nbsp;</td>
		<!-- <td><?php echo $this->Html->link($post['Type']['id'], array('controller' => 'types', 'action' => 'view', $post['Type']['id'])); ?></td> -->
		<td class="actions">
			<?php echo $this->Html->link(__('sửa', true), array('action' => 'edit', $post['posts']['id'])); ?>
			<?php echo $this->Html->link(__('xóa', true), array('action' => 'delete', $post['posts']['id']), null, sprintf(__('Bạn chắc chắn xóa tin:  %s?', true), $post['posts']['tieude'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>
</div>